-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not re-raise on errors handled in route error action. #12752
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember 2.1 introduced a regression where all errors during a transition were thrown, even when those errors had been handled in a route's error action. This PR adds a test to identify the regression, and adds some logic and state to identify errors that have been handled, and not reraise them, while maintaining the desired behaviour of throwing errors that aren't handled. This is especially valuable in any application that tests error handling. Since all errors were being thrown regardless of handling, failed assertions were being registered by qunit, and it became impossible to test application flow that entered the error hook. Further details about this issue are here: emberjs#12547 Remove leftover debugger This addresses an issue where handled errors are still thrown The added test passes on Ember 2.0. It fails on Ember 2.1 because even though the error is not bubbled, the application throws the handled error. This is contrary to what the documentation indicates. Full details about this issue are here: emberjs#12547 This PR also adds a very naive implementation of how to flag an error as having been handled and prevents reraising, while retaining the functionality of throwing errors that aren't caught, or are bubbled from the application route Make error checking methods a part of the router instance Attach error caching methods to EmberRouter, and use guids for errors Errors used as keys were just getting `.toString()`ed, so multiple `Error`s or hashes would all have the same key. This update uses ember `guidFor` to uniquely identify errors. Thanks for the help @rwjblue! When creating a new promise, resolve it. Don't fork the promise Tests expecting errors to bubble up, should bubble errors
This provides insurance that handled errors aren't swallowed
rwjblue
force-pushed
the
rebase-12549
branch
from
December 27, 2015 16:23
6fb6d95
to
a8dc7ca
Compare
rwjblue
added a commit
that referenced
this pull request
Dec 27, 2015
Do not re-raise on errors handled in route error action.
Wooooooooooooooooooooo |
Pulled into beta branch, should be published to bower/S3 soon so we can test. |
Is there a workaround for this in 2.2.x? |
Not at this time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
error
action are always rethrown (even if not bubbled)._handledErrors
(no need for computed +this.get
).All of the hard work here was done by @minasmart over in #12549.
Fixes #12547.
Fixes #12472.
Fixes #12166.